<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <title>首页</title>
    <meta name="page-view-size" content="1280*720" />
    <link rel="stylesheet" href="./css/base.css" />
    <link rel="stylesheet" href="./css/D_Volunteer_flower.css" />
    <script type="text/javascript" src="./lib/js/evm.js"></script>
    <script type="text/javascript" src="./lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="./lib/js/key.js"></script>
    <script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
    <script src="./lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="./lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="./js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="./js/public.js" type="text/javascript" charset="utf-8"></script>
</head>

<body onUnload="exitPage();">
    <div class="index-bg" id="indexMain">
        <div class="volunteer">
            <img src="images/3_slices/4228.png" />
            <div class="volunteerNum">

            </div>
        </div>
        <div class="volunteer1">
            <img src="images/3_slices/4229.png" />
            <div class="volunteerGroupNum">

            </div>
        </div>
        <div class="volunteer2">
            <img src="images/3_slices/4230.png" />
            <div class="volunteerActivityNum">

            </div>
        </div>
        <div class="model"><img src="images/3_slices/711.png" /></div>
        <div class="model"><img src="images/3_slices/710.png" /></div>
        <div class="model"><img src="images/3_slices/709.png" /></div>

    </div>

    <!--<div class="login-bg">
			<div class="login-img">
				<img id="loginImg" src="" alt="">
			</div>
			<div class="login-msg">
				请扫码登录
			</div>
		</div>-->
</body>
<script>
    // 首页视频
    var params = {};

    var modelIndex = {
        isVideo: false,
        disUser: false,
        isIndex: false,
        disHeader: true,
        index: 0, //初始位置
        listName: "model", //模块名称
        containerId: "indexMain", //包含模块的标签id
    };

    var data = [{
        name: "志愿活动",
        url: "A_SingleList.html",
        model: "volunteerActivityList",
    }, {
        name: "志愿者排行",
        url: "A_SingleList.html",
        model: "rankVolunteer",
    }, {
        name: "志愿组织",
        cid: "29",
        url: "A_SingleList.html",
        model: "rankVolunteerGroup",
    }, ];

    function getMessage() {
        var param = {
            id: TV.GetParam('id'),
            area_id: $.cookie('TV_CST_AREA'),
            // access_token: $.cookie("TV_CST_TOKEN"),
        }
        GetDatas('volunteercount', param, function(err, res) {
                mess = res.data;
                console.log(mess)

                $('.volunteerNum').html('<i>' + mess.volunteer + '</i>' + '<img src="images/gs.png" alt="">');
                $('.volunteerGroupNum').html('<i>' + mess.volunteerGroup + '</i>' + '<img src="images/gs.png" alt="">');
                $('.volunteerActivityNum').html('<i>' + mess.activity + '</i>' + '<img src="images/gs.png" alt="">');
            })
            // right.toggleFocus();
    }

    getMessage();

    function direOpt(index, directive) {
        if (directive == "backwards") {
            //左
            console.log("leftleftleft");
            if (index > 0) {
                index--
            } else {
                index = index
            }
        } else if (directive == "forwards") {
            //右
            console.log("rightright");
            // if (index == 5 || index == 3) {
            // 	index = 3;

            // } else
            if (index < $(".model").length - 1) {
                index++
            } else {
                index = index
            }
        }
        console.log(index);
        return index;
    }

    function direEnter(index) {
        console.log(index);
        // console.log(mediaStr,'333333333333333')
        // mp.stop();
        //			if(loginsize) {
        // debugger

        if (index == 0) {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        } else if (index == 1 || index == 4) {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        } else if (index == 2) {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        } else if (index == 3) {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        } else if (index === 6) {} else {
            window.location.href = data[index].url + "?titles=" + data[index].name + "&model=" + data[index].model;
        }
        //			}
    }

    function exitPage() {
        try {
            mp.stop();
            // statements
        } catch (e) {
            // statements
            console.log(e);
        }
    }
</script>

<script type="text/javascript" src="js/index.js"></script>

</html>